package com.tianqu.tms.www.car.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

import com.tianqu.tms.core.base.Logger;
import com.tianqu.tms.core.base.TmsAjaxAction;
import com.tianqu.tms.core.base.UserContext;
import com.tianqu.tms.core.exception.TmsException;
import com.tianqu.tms.core.util.StringUtil;
import com.tianqu.tms.entity.Member;

import net.sf.json.JSONArray;

/**
 *  huangwei st2
 */
public class MemberSearchAjaxAction extends TmsAjaxAction{
	private Logger logger = Logger.getLogger(CarLoadBrandInputAjaxAction.class);
	@Override
	public void process( ActionMapping mapping, ActionForm form
	                                          , HttpServletRequest request
	                                          , HttpServletResponse response
	                                          , UserContext uc)throws TmsException {
		logger.debug(this.getClass().getName() + "#execute.");
		Member menber = Member.getInstance();
		String namePy = request.getParameter("namePy");
		if(StringUtil.isNullOrBlank(namePy)) responseValues(response, JSONArray.fromObject(menber.findAllMemInfo(1)).toString(), TEXT);
		else responseValues(response, JSONArray.fromObject(menber.findAllMemInfo(namePy,1)).toString(), TEXT);
		logger.debug(this.getClass().getName() + "#doAction was completed.");
	}
}
